package com.yami.shop.mystery.common.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yami.shop.mystery.common.dao.MysteryBoxExtensionMapper;
import com.yami.shop.mystery.common.dao.MysteryBoxMapper;
import com.yami.shop.mystery.common.model.MysteryBox;
import com.yami.shop.mystery.common.model.MysteryBoxExtension;
import com.yami.shop.mystery.common.service.MysteryBoxExtensionService;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 盲盒商品扩展表 业务实现类
 *
 * @author wxf
 * @date 2023/4/10 10:32
 */
@Service
@AllArgsConstructor
public class MysteryBoxExtensionServiceImpl extends ServiceImpl<MysteryBoxExtensionMapper, MysteryBoxExtension> implements MysteryBoxExtensionService {

    private final MysteryBoxExtensionMapper mysteryBoxExtensionMapper;

    @Override
    public List<MysteryBoxExtension> findExtensionByBoxId(Long boxId) {
        return mysteryBoxExtensionMapper.findExtensionByBoxId(boxId);
    }

    @Override
    public int rollbackStocks(MysteryBoxExtension extension) {
        return mysteryBoxExtensionMapper.rollbackStocks(extension);
    }
}
